package dyyx;
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.startup.Tomcat;

public class Main {

	public static void main(String[] args) throws Exception {
		Tomcat tomcat = new Tomcat();
        // tomcat.setHostname("dyyx");
        tomcat.setPort(8086);
        // tomcat.setBaseDir("/tmp/");
        String contextPath = "";

        StandardContext context = new StandardContext();
        context.setPath(contextPath);
        context.addLifecycleListener(new Tomcat.FixContextListener());
        tomcat.getHost().addChild(context);

        tomcat.addServlet(contextPath, "hello", new HelloServlet());
        context.addServletMapping("/hello", "hello");

        tomcat.start();

        tomcat.getServer().await();
		
	}
}
